/**      
 * @file		concat.cpp
 * @description	This example demonstrates string concatenation
 *				and cString concatenation.
 * @course		CSCI 123 Section 00000
 * @assignment 
 * @date		mm/dd/yyyy
 * @author		Brad Rippe (00000000) brippe@fullcoll.edu
 * @version		1.0
 */
#include <iostream>
#include <cstring>
#include <string>
using namespace std;

/*
	You can use the flag to automatically call the secure functions
	in your code without changing strcpy, strcat, etc.
	ONLY ON WINDOWS
	#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
*/

/**
 * @return zero if the application executes successfully
 */
int main() {
	char cString1[80] = "I wonder if you're really";
	char cString2[] = " going to read this??";

	string string1 = "There might be ";
	string string2 = "a good chance that you will!";

	// the book uses strcat
	// we'll use strcat_s() because we can I want to show
	// how it is used. strcat_s() is a more secure version
	// of strcat()
	cout << "Output the cstrings\n";
	cout << "cString1 = " << cString1 << endl;
	cout << "cString2 = " << cString2 << endl;
	strcat(cString1, cString2);
	//strcat_s(cString1, cString2); ONLY ON WINDOWS
	cout << "Concatenating cString1 with cString2 = ";
	cout << cString1 << endl;

	// the + operator doesn't add the characters but
	// concatenates the strings together creating one
	// string
	cout << "Output the strings\n";
	cout << "string1 = " << string1 << endl;
	cout << "string2 = " << string2 << endl;
	cout << "string1 + string2 = ";			
	cout << string1 + string2 << endl;
	return 0;
}

